 
function bbd_t_dg(prefix){
	_zae_t_dg(prefix);
	//重写查询按钮的方法
	$('#'+prefix+'_commDataLeftD a[id='+prefix+'_dataQuery]').attr('onclick','dbdlQuery(this)');
}
//查询方法
function dbdlQuery(obj){
	var prefix=$(obj).attr('pre');
	var dsId=$(obj).attr('dsid');
	var resultDG = 'DATA_DATALIST';
	var comUseConf='commUseD';
	 //获取印长Id
    var manId = $('#bbd_addWinTable input[qucln=OUT_MAN]').val();
	var otherConfig = "1-OUT_MAN-"+manId+"-inc|+"; 
	var comUse = parseConfig(prefix+"_"+comUseConf);
	var useConf = otherConfig+comUse;
	$('#'+prefix+"_"+resultDG).datagrid({
		url:_m_url+'framework/loadDataQ',
		queryParams:{'dsId':dsId,'config':useConf}
	});
}

/**
 * 材料调拨的添加材料的确定按钮
 * 
 * @return
 */
function _bbd_sure() {
	var inId = $('#bbd_addWinTable input[qucln=OUT_ID]').val();
	$('#zaf_DATA_PARENT_PANEL').window('close');
	var selRows = $('#zaf_DATA_DATALIST').datagrid('getSelections');
	var oldRows = $('#bbd_DATALIST').datagrid('getRows');
	var sortNum = getSortNum('bbd');
	var price = '';
	// 顺序号
	for ( var i = 0; i < selRows.length; i++) {
			if (selRows[i].U_ID == 'cljlUnit.003') { // 张
				price = selRows[i].CL_ZJ;
			} else if (selRows[i].U_ID == 'cljlUnit.002') { // 令
				price = selRows[i].CL_LJ;
			}
		$('#bbd_addItemDatagrid').datagrid('appendRow', {
			OUT_ID : inId,
			CL_ID :  selRows[i].CL_ID,
			AMOUNT:'1',
			ST_UNIT: selRows[i].U_ID,
			CL_STANDARD:selRows[i].CL_STANDARD,
			CL_HETONGHAO:selRows[i].CL_HETONGHAO,
			CL_WEIGHT:selRows[i].CL_WEIGHT,
			TAX_RATE:'0',
			L_AMOUNT:selRows[i].L_AMOUNT,
			Z_AMOUNT:selRows[i].ZHANG_AMOUNT,
			SORT_NUM:sortNum+1+i,
			CL_PRICE:price
		});
	}
}
/**
 * 材料调拨enter事件之后的赋值
 * 
 * @param data
 * @return
 */
function bbd_onClickButn(data,dgUrl,queryParams){
	var inId = $('#bbd_addWinTable input[qucln=OUT_ID]').val();
	var sortNum = getSortNum('bbd');									// 顺序号
	if (data.rows.length == 1) {
		$('#bbd_addItemDatagrid').datagrid('appendRow', {
			OUT_ID : inId,
			CL_ID : data.rows[0].CL_ID,
			AMOUNT:'1',
			CL_UNIT:data.row[0].U_ID,
			CL_STANDARD:data.row[0].CL_STANDARD,
			CL_HETONGHAO:data.row[0].CL_HETONGHAO,
			CL_WEIGHT:data.row[0].CL_WEIGHT,
			TAX_RATE:'0',
			L_AMOUNT:data.row[0].L_AMOUNT,
			Z_AMOUNT:data.row[0].ZHANG_AMOUNT,
			SORT_NUM:sortNum+1
		});
	} else if (data.rows.length > 1) {
		_data_qw('zaf', 'ds_bs_material4', 'bbd_sure', '44','bbd_t_dg',data,dgUrl,queryParams);
	} else if (data.rows.length < 1) {
		$.messager.alert('温馨提示', '亲，您查询的材料不存在哦！');
	}
}